﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XZL.GM.Bll;
using XZL.GM.Dal;


public partial class User_UserReferrer : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            HeadImg.Visible = true;
            BindUserReferrer();
        }
    }


    /// <summary>
    /// 初始化数据
    /// </summary>
    private void BindUserReferrer()
     {
         string userID = Request.QueryString["UserID"];

     }


    /// <summary>
    /// 修改邀请人
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string userID = Request.QueryString["UserID"];
       
        if (userID != null)
        {
            string phone = Request.Params["txtMobilePhone"];

            Proc_UserInfo_SelectUserInfoResult userPhone = UserInfoBiz.GetUserInfo(userID);
            if (phone.Length == 11 && phone != userPhone.MobilePhone)
            {

                bool b = UserInfoBiz.UpdateReferrer(userID, txtMobilePhone.Text);

                if (b)
                {
                    lblWarn.Text = "修改成功！";
                    lblWarn.ForeColor = System.Drawing.Color.Green;
                    btnOK.Enabled = false;
                }
                else
                {
                    lblWarn.Text = "修改失败！";
                    lblWarn.ForeColor = System.Drawing.Color.Red;

                }

              }
            else {
                lblWarn.Text = "手机号输入不正确！";
                HeadImg.Visible = false;
              }
        }
    }












}